SearchBoxOptions (Simple Usage)

The SearchBoxOptions control provides a readily useable (although less flexible than the following example) way to add content and/or location category search options to the page. This control is designed to be used on the same page as the SearchBox control, however for an example showing result page switching of categories, please see the demo projects.

Example Code

<SearchEngine:SearchBoxOptions id="Searchboxoptions1" runat="server"
    SearchBoxId="SearchBox1"
    Contents="Books,Stationary,Messages"
    Locations="All,Community">
    <ContentCheckBoxes ForeColor="Gray">
        <CheckBoxesFont Size="10pt" Overline="False" Underline="False" Italic="False" Name="Arial" Bold="False" Strikeout="False"></CheckBoxesFont>
    </ContentCheckBoxes>
    <LocationDropDownList Font-Bold="True"></LocationDropDownList>

</SearchEngine:SearchBoxOptions>

The SearchBoxId property points to the ID of the SearchBox control (which must be on the page), through this the options are attached to the request. The ContentCheckBoxes control is similar to the CheckBoxList control and allows style to be specified for the content category checkboxes. The LocationDropDownList property is a DropDownList control, and again allows appearance to be specified. It is not necessary to specify both content and locations, if either are omitted, the corresponding control is not shown.

Automatic Setup

By default any Location and Content categories setup for the Index Directory will automatically be used to create the search options.

AutoGenerateFromIndexDirectory should be set to the Index Directory to be used to create the category options. AutoGenerateContentCheckBoxes and AutoGenerateLocationDropDown can each be set True or False depending on which options to display.

Manual Setup

To setup the search options manually, set AutoGenerateContentCheckBoxes and/or AutoGenerateLocationDropDown properties to False and add the options to be used to the Contents and Locations properties. These are comma delimited lists of available content and location categories and must match the names stored in the index exactly..